1. Field of the Invention
The present invention relates to a method of compressing an image with multiple gradations.
2. Description of the Related Art
Recently, the amount of data used to form an image has increased remarkably as color images became widespread and subsequently began to have multiple gradations. Concurrently with an increase in the amount of data in an image, a variety of data compression methods such as encoding have been studied earnestly in order to decrease the amount of data in an image. Heretofore, there have been proposed various methods of compressing an image. According to these methods, an original image can be accurately restored after an image has been coded by some suitable means such as compression. However, an image compression method which is generally used under the circumstances that an original image need not be restored with a high accuracy has not been studied yet so earnestly.
Heretofore, a method of compressing an image, known as block approximation coding, in which an image with multiple gradations is divided into pixel blocks each pixel block comprises a plurality of adjacent pixels. The image is compressed by expressing the pixel block with two representing values and a block pattern obtained by a binary processing.
The conventional block approximation coding will hereinafter be described with reference to FIGS. 10 and 11.
FIG. 10 is a schematic diagram used to explain a conventional method of compressing and expanding an image. Image data is recognized as a block of every pixel. All pixels are divided into the blocks each of which comprises 4.times.4=16 pixels as shown by block image data 17 in FIG. 10, and the image data is processed at every block. A numerical value in the block represents a gradation of a pixel data.
FIG. 11 is a flowchart to which reference will be made in explaining the above-mentioned conventional method of compressing and expanding image data. Referring initially to FIG. 11, and following the start of operation, control goes to a step S41, at which image data with multiple gradations is inputted. Then, control goes to the next step S42, at which the image data is divided into a plurality of blocks each of which comprises 4 pixels.times.4 pixels as shown in FIG. 10. Then, control goes to the next step S43, at which image data of the first block is read out, and the block image data 17 shown in FIG. 10 is obtained. Then, control goes to the next step S44, at which an average value of 16 pixel data within the block is calculated. Control goes to the next step S45, whereat, as shown by a resolution pattern 19 in FIG. 10, the pixels within the block are divided into a group (blocks shown by 1) of pixel level higher than the average level and a group (blocks shown by 0) of pixel level below the average level, thereby resulting in the divided patterns being generated as the resolution pattern 19. Then, control goes to the next step S46. At the step S46, calculating average values of the two groups in the resolution pattern 19, the average value of the group of 1 is obtained as 130 from the block image data 17, and the average value of the group of 0 is obtained as 97 from the block image data 17. Then, control goes to the next step S46, at which these values are set to representing values 18. According to the aforementioned processing, the block image data 17 comprising 16 pixels is converted into the two representing values 18 and the binary resolution pattern 19.
Subsequently, control goes to the next step S47, at which the image data compressed by the above-mentioned compression processing is expanded. In this image data expansion processing of the step S47, block decoded data 20 which indicates the pixel levels of the block is reproduced from the resolution pattern 19 and the representing values 18 by block approximation decoding. Control goes to the next step S48, at which the block decoded data 20 is memorized.
As set forth above, the image expansion and compression of the first block are finished, and it is determined at a decision step S49. Then, control goes to the next step S50 at which image data of the next block is read out. Then, control goes back to the step S43, and the steps S43 to S48 are repeated. When the compression and expansion of image data of all blocks are already finished as represented by a YES at the decision step S49, then control goes to the next step S51, at which the above-mentioned image data are outputted as image decoded data. Then, the process of image compression and image expansion is ended.
However, according to the above-mentioned block approximation coding, the resolution pattern is processed only by the binary processing, but not processed by compression. Therefore, there is still yet a room to increase a compression rate much more.